import React from 'react'
import { Mask } from 'antd-mobile'
import './index.less'

function AmeModal({ title, cancelText, confirmText, children, visible, onConfirm, onCancel, className, disabledConfirm }) {
  return (
    <Mask visible={visible}>
      <div className={`modal_content ${className || ''}`}>
        <div className="tit">{title}</div>
        <div className="info">{children}</div>
        <div className="action">
          <div className="cancel_btn btn" onClick={onCancel}>
            {cancelText || '取消'}
          </div>
          <div className={`confirm_btn btn ${disabledConfirm ? 'disabled' : ''}`} onClick={!disabledConfirm ? onConfirm : null}>
            {confirmText || '确定'}
          </div>
        </div>
      </div>
    </Mask>
  )
}

export default AmeModal
